<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pyprocessing.transformations</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pyprocessing-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="pyprocessing-module.html">Package&nbsp;pyprocessing</a> ::
        Module&nbsp;transformations
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="pyprocessing.transformations-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="pyprocessing.transformations-module.html">Module pyprocessing.transformations</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment">#************************</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#  TRANSFORMATIONS STUFF </tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#************************</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">ctypes</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">pyglet</tt><tt class="py-op">.</tt><tt class="py-name">gl</tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Module pyprocessing.globs=pyprocessing.globs-module.html"><a title="pyprocessing.globs" class="py-name" href="#" onclick="return doclink('link-0', 'globs', 'link-0');">globs</a></tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-1" class="py-name" targets="Module pyprocessing.constants=pyprocessing.constants-module.html"><a title="pyprocessing.constants" class="py-name" href="#" onclick="return doclink('link-1', 'constants', 'link-1');">constants</a></tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">math</tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-2" class="py-name" targets="Module pyprocessing.config=pyprocessing.config-module.html,Variable pyprocessing.globs.canvas.config=pyprocessing.globs.canvas-class.html#config"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-2', 'config', 'link-2');">config</a></tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-name">__all__</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-string">'pushMatrix'</tt><tt class="py-op">,</tt> <tt class="py-string">'popMatrix'</tt><tt class="py-op">,</tt> <tt class="py-string">'resetMatrix'</tt><tt class="py-op">,</tt> <tt class="py-string">'applyMatrix'</tt><tt class="py-op">,</tt> <tt class="py-string">'getMatrix'</tt><tt class="py-op">,</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line">         <tt class="py-string">'printMatrix'</tt><tt class="py-op">,</tt> <tt class="py-string">'getProjection'</tt><tt class="py-op">,</tt> <tt class="py-string">'printProjection'</tt><tt class="py-op">,</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line">         <tt class="py-string">'translate'</tt><tt class="py-op">,</tt> <tt class="py-string">'rotate'</tt><tt class="py-op">,</tt> <tt class="py-string">'rotateX'</tt><tt class="py-op">,</tt> <tt class="py-string">'rotateY'</tt><tt class="py-op">,</tt> <tt class="py-string">'rotateZ'</tt><tt class="py-op">,</tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line">         <tt class="py-string">'scale'</tt><tt class="py-op">,</tt> <tt class="py-string">'camera'</tt><tt class="py-op">,</tt> <tt class="py-string">'perspective'</tt><tt class="py-op">,</tt> <tt class="py-string">'ortho'</tt><tt class="py-op">,</tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line">         <tt class="py-string">'screenXYZ'</tt><tt class="py-op">,</tt> <tt class="py-string">'screenX'</tt><tt class="py-op">,</tt> <tt class="py-string">'screenY'</tt><tt class="py-op">,</tt> <tt class="py-string">'screenZ'</tt><tt class="py-op">,</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line">         <tt class="py-string">'modelXYZ'</tt><tt class="py-op">,</tt><tt class="py-string">'modelX'</tt><tt class="py-op">,</tt> <tt class="py-string">'modelY'</tt><tt class="py-op">,</tt> <tt class="py-string">'modelZ'</tt><tt class="py-op">,</tt> <tt class="py-string">'shearX'</tt><tt class="py-op">,</tt> <tt class="py-string">'shearY'</tt><tt class="py-op">]</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line">          </tt>
<a name="pushMatrix"></a><div id="pushMatrix-def"><a name="L19"></a><tt class="py-lineno"> 19</tt> <a class="py-toggle" href="#" id="pushMatrix-toggle" onclick="return toggle('pushMatrix');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#pushMatrix">pushMatrix</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt>  </tt>
</div><a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line">    <tt class="py-docstring">"""Saves current transformation"""</tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line">    <tt id="link-3" class="py-name" targets="Variable pyprocessing.lights'.glPushMatrix=pyprocessing.lights%27-module.html#glPushMatrix"><a title="pyprocessing.lights'.glPushMatrix" class="py-name" href="#" onclick="return doclink('link-3', 'glPushMatrix', 'link-3');">glPushMatrix</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line">     </tt>
<a name="popMatrix"></a><div id="popMatrix-def"><a name="L23"></a><tt class="py-lineno"> 23</tt> <a class="py-toggle" href="#" id="popMatrix-toggle" onclick="return toggle('popMatrix');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#popMatrix">popMatrix</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="popMatrix-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="popMatrix-expanded"><a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line">    <tt class="py-docstring">"""Restores previous transformation"""</tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line">    <tt id="link-4" class="py-name" targets="Variable pyprocessing.lights'.glPopMatrix=pyprocessing.lights%27-module.html#glPopMatrix"><a title="pyprocessing.lights'.glPopMatrix" class="py-name" href="#" onclick="return doclink('link-4', 'glPopMatrix', 'link-4');">glPopMatrix</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line">     </tt>
<a name="resetMatrix"></a><div id="resetMatrix-def"><a name="L27"></a><tt class="py-lineno"> 27</tt> <a class="py-toggle" href="#" id="resetMatrix-toggle" onclick="return toggle('resetMatrix');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#resetMatrix">resetMatrix</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="resetMatrix-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="resetMatrix-expanded"><a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line">    <tt class="py-docstring">"""Loads an identity matrix"""</tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line">    <tt id="link-5" class="py-name" targets="Variable pyprocessing.lights'.glLoadIdentity=pyprocessing.lights%27-module.html#glLoadIdentity"><a title="pyprocessing.lights'.glLoadIdentity" class="py-name" href="#" onclick="return doclink('link-5', 'glLoadIdentity', 'link-5');">glLoadIdentity</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line">     </tt>
<a name="applyMatrix"></a><div id="applyMatrix-def"><a name="L31"></a><tt class="py-lineno"> 31</tt> <a class="py-toggle" href="#" id="applyMatrix-toggle" onclick="return toggle('applyMatrix');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#applyMatrix">applyMatrix</a><tt class="py-op">(</tt><tt class="py-param">n00</tt><tt class="py-op">,</tt> <tt class="py-param">n01</tt><tt class="py-op">,</tt> <tt class="py-param">n02</tt><tt class="py-op">,</tt> <tt class="py-param">n03</tt><tt class="py-op">,</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line">                <tt class="py-param">n04</tt><tt class="py-op">,</tt> <tt class="py-param">n05</tt><tt class="py-op">,</tt> <tt class="py-param">n06</tt><tt class="py-op">,</tt> <tt class="py-param">n07</tt><tt class="py-op">,</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line">                <tt class="py-param">n08</tt><tt class="py-op">,</tt> <tt class="py-param">n09</tt><tt class="py-op">,</tt> <tt class="py-param">n10</tt><tt class="py-op">,</tt> <tt class="py-param">n11</tt><tt class="py-op">,</tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line">                <tt class="py-param">n12</tt><tt class="py-op">,</tt> <tt class="py-param">n13</tt><tt class="py-op">,</tt> <tt class="py-param">n14</tt><tt class="py-op">,</tt> <tt class="py-param">n15</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="applyMatrix-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="applyMatrix-expanded"><a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line">    <tt class="py-docstring">"""Applies matrix."""</tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line">    <tt class="py-comment"># notice that processing uses a transposed matrix</tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt id="link-6" class="py-name" targets="Variable pyprocessing.lights'.glMultMatrixf=pyprocessing.lights%27-module.html#glMultMatrixf"><a title="pyprocessing.lights'.glMultMatrixf" class="py-name" href="#" onclick="return doclink('link-6', 'glMultMatrixf', 'link-6');">glMultMatrixf</a></tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_float</tt> <tt class="py-op">*</tt> <tt class="py-number">16</tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-name">n00</tt><tt class="py-op">,</tt> <tt class="py-name">n04</tt><tt class="py-op">,</tt> <tt class="py-name">n08</tt><tt class="py-op">,</tt> <tt class="py-name">n12</tt><tt class="py-op">,</tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line">                <tt class="py-name">n01</tt><tt class="py-op">,</tt> <tt class="py-name">n05</tt><tt class="py-op">,</tt> <tt class="py-name">n09</tt><tt class="py-op">,</tt> <tt class="py-name">n13</tt><tt class="py-op">,</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line">                <tt class="py-name">n02</tt><tt class="py-op">,</tt> <tt class="py-name">n06</tt><tt class="py-op">,</tt> <tt class="py-name">n10</tt><tt class="py-op">,</tt> <tt class="py-name">n14</tt><tt class="py-op">,</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line">                <tt class="py-name">n03</tt><tt class="py-op">,</tt> <tt class="py-name">n07</tt><tt class="py-op">,</tt> <tt class="py-name">n11</tt><tt class="py-op">,</tt> <tt class="py-name">n15</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line"> </tt>
<a name="shearX"></a><div id="shearX-def"><a name="L42"></a><tt class="py-lineno"> 42</tt> <a class="py-toggle" href="#" id="shearX-toggle" onclick="return toggle('shearX');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#shearX">shearX</a><tt class="py-op">(</tt><tt class="py-param">angle</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="shearX-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="shearX-expanded"><a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line">    <tt class="py-docstring">"""Shears a shape around the x-axis the amount specified by the angle</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line"><tt class="py-docstring">    parameter"""</tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line">    <tt class="py-comment"># notice that processing uses a transposed matrix</tt> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt id="link-7" class="py-name"><a title="pyprocessing.lights'.glMultMatrixf" class="py-name" href="#" onclick="return doclink('link-7', 'glMultMatrixf', 'link-6');">glMultMatrixf</a></tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_float</tt> <tt class="py-op">*</tt> <tt class="py-number">16</tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line">                <tt class="py-name">angle</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line">                <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line">                <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line"> </tt>
<a name="shearY"></a><div id="shearY-def"><a name="L51"></a><tt class="py-lineno"> 51</tt> <a class="py-toggle" href="#" id="shearY-toggle" onclick="return toggle('shearY');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#shearY">shearY</a><tt class="py-op">(</tt><tt class="py-param">angle</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="shearY-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="shearY-expanded"><a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line">    <tt class="py-docstring">""" Shears a shape around the y-axis the amount specified by the angle</tt> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line"><tt class="py-docstring">    parameter."""</tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">    <tt class="py-comment"># notice that processing uses a transposed matrix</tt> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt id="link-8" class="py-name"><a title="pyprocessing.lights'.glMultMatrixf" class="py-name" href="#" onclick="return doclink('link-8', 'glMultMatrixf', 'link-6');">glMultMatrixf</a></tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_float</tt> <tt class="py-op">*</tt> <tt class="py-number">16</tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-name">angle</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">                <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line">                <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">                <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line"> </tt>
<a name="getMatrix"></a><div id="getMatrix-def"><a name="L60"></a><tt class="py-lineno"> 60</tt> <a class="py-toggle" href="#" id="getMatrix-toggle" onclick="return toggle('getMatrix');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#getMatrix">getMatrix</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="getMatrix-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="getMatrix-expanded"><a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line">    <tt class="py-docstring">"""Returns the MODELVIEW matrix as a tuple."""</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line">    <tt class="py-name">matrix</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_double</tt><tt class="py-op">*</tt><tt class="py-number">16</tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line">    <tt id="link-9" class="py-name" targets="Variable pyprocessing.lights'.glGetDoublev=pyprocessing.lights%27-module.html#glGetDoublev"><a title="pyprocessing.lights'.glGetDoublev" class="py-name" href="#" onclick="return doclink('link-9', 'glGetDoublev', 'link-9');">glGetDoublev</a></tt> <tt class="py-op">(</tt><tt id="link-10" class="py-name" targets="Variable pyprocessing.lights'.GL_MODELVIEW_MATRIX=pyprocessing.lights%27-module.html#GL_MODELVIEW_MATRIX"><a title="pyprocessing.lights'.GL_MODELVIEW_MATRIX" class="py-name" href="#" onclick="return doclink('link-10', 'GL_MODELVIEW_MATRIX', 'link-10');">GL_MODELVIEW_MATRIX</a></tt><tt class="py-op">,</tt> <tt class="py-name">matrix</tt><tt class="py-op">)</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">tuple</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">matrix</tt> <tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">16</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
</div><a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line"> </tt>
<a name="getProjection"></a><div id="getProjection-def"><a name="L66"></a><tt class="py-lineno"> 66</tt> <a class="py-toggle" href="#" id="getProjection-toggle" onclick="return toggle('getProjection');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#getProjection">getProjection</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="getProjection-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="getProjection-expanded"><a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line">    <tt class="py-docstring">"""Returns the PROJECTION matrix as a tuple."""</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">    <tt class="py-name">matrix</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_double</tt><tt class="py-op">*</tt><tt class="py-number">16</tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line">    <tt id="link-11" class="py-name"><a title="pyprocessing.lights'.glGetDoublev" class="py-name" href="#" onclick="return doclink('link-11', 'glGetDoublev', 'link-9');">glGetDoublev</a></tt> <tt class="py-op">(</tt><tt id="link-12" class="py-name" targets="Variable pyprocessing.lights'.GL_PROJECTION_MATRIX=pyprocessing.lights%27-module.html#GL_PROJECTION_MATRIX"><a title="pyprocessing.lights'.GL_PROJECTION_MATRIX" class="py-name" href="#" onclick="return doclink('link-12', 'GL_PROJECTION_MATRIX', 'link-12');">GL_PROJECTION_MATRIX</a></tt><tt class="py-op">,</tt> <tt class="py-name">matrix</tt><tt class="py-op">)</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">tuple</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">matrix</tt> <tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">16</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
</div><a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">     </tt>
<a name="printMatrix"></a><div id="printMatrix-def"><a name="L72"></a><tt class="py-lineno"> 72</tt> <a class="py-toggle" href="#" id="printMatrix-toggle" onclick="return toggle('printMatrix');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#printMatrix">printMatrix</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="printMatrix-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="printMatrix-expanded"><a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line">    <tt class="py-docstring">"""Prints the MODELVIEW matrix."""</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line">    <tt class="py-keyword">print</tt> <tt id="link-13" class="py-name" targets="Function pyprocessing.transformations.getMatrix()=pyprocessing.transformations-module.html#getMatrix"><a title="pyprocessing.transformations.getMatrix" class="py-name" href="#" onclick="return doclink('link-13', 'getMatrix', 'link-13');">getMatrix</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line"> </tt>
<a name="printProjection"></a><div id="printProjection-def"><a name="L76"></a><tt class="py-lineno"> 76</tt> <a class="py-toggle" href="#" id="printProjection-toggle" onclick="return toggle('printProjection');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#printProjection">printProjection</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="printProjection-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="printProjection-expanded"><a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line">    <tt class="py-docstring">"""Prints the PROJECTION matrix."""</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line">    <tt class="py-keyword">print</tt> <tt id="link-14" class="py-name" targets="Function pyprocessing.transformations.getProjection()=pyprocessing.transformations-module.html#getProjection"><a title="pyprocessing.transformations.getProjection" class="py-name" href="#" onclick="return doclink('link-14', 'getProjection', 'link-14');">getProjection</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line"> </tt>
<a name="translate"></a><div id="translate-def"><a name="L80"></a><tt class="py-lineno"> 80</tt> <a class="py-toggle" href="#" id="translate-toggle" onclick="return toggle('translate');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#translate">translate</a><tt class="py-op">(</tt><tt class="py-param">x</tt><tt class="py-op">,</tt><tt class="py-param">y</tt><tt class="py-op">,</tt><tt class="py-param">z</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="translate-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="translate-expanded"><a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line">    <tt class="py-docstring">"""Translation transformation"""</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line">    <tt id="link-15" class="py-name" targets="Variable pyprocessing.lights'.glTranslatef=pyprocessing.lights%27-module.html#glTranslatef"><a title="pyprocessing.lights'.glTranslatef" class="py-name" href="#" onclick="return doclink('link-15', 'glTranslatef', 'link-15');">glTranslatef</a></tt><tt class="py-op">(</tt><tt id="link-16" class="py-name" targets="Variable pyprocessing.globs.mouse.x=pyprocessing.globs.mouse-class.html#x,Variable pyprocessing.globs.pmouse.x=pyprocessing.globs.pmouse-class.html#x,Variable pyprocessing.pvector.PVector.x=pyprocessing.pvector.PVector-class.html#x"><a title="pyprocessing.globs.mouse.x
pyprocessing.globs.pmouse.x
pyprocessing.pvector.PVector.x" class="py-name" href="#" onclick="return doclink('link-16', 'x', 'link-16');">x</a></tt><tt class="py-op">,</tt><tt id="link-17" class="py-name" targets="Variable pyprocessing.globs.mouse.y=pyprocessing.globs.mouse-class.html#y,Variable pyprocessing.globs.pmouse.y=pyprocessing.globs.pmouse-class.html#y,Variable pyprocessing.pvector.PVector.y=pyprocessing.pvector.PVector-class.html#y"><a title="pyprocessing.globs.mouse.y
pyprocessing.globs.pmouse.y
pyprocessing.pvector.PVector.y" class="py-name" href="#" onclick="return doclink('link-17', 'y', 'link-17');">y</a></tt><tt class="py-op">,</tt><tt id="link-18" class="py-name" targets="Variable pyprocessing.pvector.PVector.z=pyprocessing.pvector.PVector-class.html#z"><a title="pyprocessing.pvector.PVector.z" class="py-name" href="#" onclick="return doclink('link-18', 'z', 'link-18');">z</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line"> </tt>
<a name="rotate"></a><div id="rotate-def"><a name="L84"></a><tt class="py-lineno"> 84</tt> <a class="py-toggle" href="#" id="rotate-toggle" onclick="return toggle('rotate');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#rotate">rotate</a><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="rotate-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="rotate-expanded"><a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">    <tt class="py-docstring">"""Rotation transformation. Angles in radians"""</tt> </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> <tt id="link-19" class="py-name" targets="Variable pyprocessing.lights'.glRotatef=pyprocessing.lights%27-module.html#glRotatef"><a title="pyprocessing.lights'.glRotatef" class="py-name" href="#" onclick="return doclink('link-19', 'glRotatef', 'link-19');">glRotatef</a></tt><tt class="py-op">(</tt><tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">degrees</tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> <tt id="link-20" class="py-name"><a title="pyprocessing.lights'.glRotatef" class="py-name" href="#" onclick="return doclink('link-20', 'glRotatef', 'link-19');">glRotatef</a></tt><tt class="py-op">(</tt><tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">degrees</tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">args</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">args</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">args</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
</div><a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line"> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line"><tt class="py-name">rotateZ</tt> <tt class="py-op">=</tt> <tt id="link-21" class="py-name" targets="Function pyprocessing.transformations.rotate()=pyprocessing.transformations-module.html#rotate"><a title="pyprocessing.transformations.rotate" class="py-name" href="#" onclick="return doclink('link-21', 'rotate', 'link-21');">rotate</a></tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line"> </tt>
<a name="rotateX"></a><div id="rotateX-def"><a name="L91"></a><tt class="py-lineno"> 91</tt> <a class="py-toggle" href="#" id="rotateX-toggle" onclick="return toggle('rotateX');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#rotateX">rotateX</a><tt class="py-op">(</tt><tt class="py-param">angle</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="rotateX-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="rotateX-expanded"><a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line">    <tt class="py-docstring">"""Rotation around the X axis"""</tt> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">    <tt id="link-22" class="py-name"><a title="pyprocessing.transformations.rotate" class="py-name" href="#" onclick="return doclink('link-22', 'rotate', 'link-21');">rotate</a></tt> <tt class="py-op">(</tt><tt class="py-name">angle</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
</div><a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line"> </tt>
<a name="rotateY"></a><div id="rotateY-def"><a name="L95"></a><tt class="py-lineno"> 95</tt> <a class="py-toggle" href="#" id="rotateY-toggle" onclick="return toggle('rotateY');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#rotateY">rotateY</a><tt class="py-op">(</tt><tt class="py-param">angle</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="rotateY-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="rotateY-expanded"><a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line">    <tt class="py-docstring">"""Rotation around the Y axis"""</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line">    <tt id="link-23" class="py-name"><a title="pyprocessing.transformations.rotate" class="py-name" href="#" onclick="return doclink('link-23', 'rotate', 'link-21');">rotate</a></tt> <tt class="py-op">(</tt><tt class="py-name">angle</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
</div><a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line">     </tt>
<a name="scale"></a><div id="scale-def"><a name="L99"></a><tt class="py-lineno"> 99</tt> <a class="py-toggle" href="#" id="scale-toggle" onclick="return toggle('scale');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#scale">scale</a><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="scale-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="scale-expanded"><a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line">    <tt class="py-docstring">"""Scale transformation"""</tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> <tt id="link-24" class="py-name" targets="Variable pyprocessing.lights'.glScalef=pyprocessing.lights%27-module.html#glScalef"><a title="pyprocessing.lights'.glScalef" class="py-name" href="#" onclick="return doclink('link-24', 'glScalef', 'link-24');">glScalef</a></tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">args</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">args</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line">    <tt class="py-keyword">elif</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-number">2</tt><tt class="py-op">:</tt> <tt id="link-25" class="py-name"><a title="pyprocessing.lights'.glScalef" class="py-name" href="#" onclick="return doclink('link-25', 'glScalef', 'link-24');">glScalef</a></tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">args</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> <tt id="link-26" class="py-name"><a title="pyprocessing.lights'.glScalef" class="py-name" href="#" onclick="return doclink('link-26', 'glScalef', 'link-24');">glScalef</a></tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">args</tt><tt class="py-op">)</tt> </tt>
</div><a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line"> </tt>
<a name="camera"></a><div id="camera-def"><a name="L105"></a><tt class="py-lineno">105</tt> <a class="py-toggle" href="#" id="camera-toggle" onclick="return toggle('camera');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#camera">camera</a> <tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="camera-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="camera-expanded"><a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line">    <tt class="py-docstring">"""Args should either be empty or be of the form </tt> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line"><tt class="py-docstring">    (eyex,eyey,eyez,centerx, centery, centerz, upx, upy, upz).</tt> </tt>
<a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line"><tt class="py-docstring">    Creates a viewing transformation given the camera position</tt> </tt>
<a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line"><tt class="py-docstring">    (eyex,eyey,eyez), the center of the scene (centerx, centery, centerz) and</tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line"><tt class="py-docstring">    a vector to be used as the up direction (upx, upy, upz). If no args</tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line"><tt class="py-docstring">    are passed, the standard camera is created."""</tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line">    <tt id="link-27" class="py-name"><a title="pyprocessing.lights'.glLoadIdentity" class="py-name" href="#" onclick="return doclink('link-27', 'glLoadIdentity', 'link-5');">glLoadIdentity</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line">     </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line">        <tt class="py-comment"># default camera</tt> </tt>
<a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt id="link-28" class="py-name"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-28', 'config', 'link-2');">config</a></tt><tt class="py-op">.</tt><tt id="link-29" class="py-name" targets="Variable pyprocessing.config.halfPixelShiftHack=pyprocessing.config-module.html#halfPixelShiftHack"><a title="pyprocessing.config.halfPixelShiftHack" class="py-name" href="#" onclick="return doclink('link-29', 'halfPixelShiftHack', 'link-29');">halfPixelShiftHack</a></tt><tt class="py-op">:</tt> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line">            <tt class="py-comment"># Add a half-pixel shift in order to obtain sharper lines</tt> </tt>
<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt id="link-30" class="py-name"><a title="pyprocessing.lights'.glTranslatef" class="py-name" href="#" onclick="return doclink('link-30', 'glTranslatef', 'link-15');">glTranslatef</a></tt><tt class="py-op">(</tt><tt class="py-number">0.5</tt><tt class="py-op">,</tt><tt class="py-number">0.5</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line">        <tt id="link-31" class="py-name" targets="Variable pyprocessing.lights'.gluLookAt=pyprocessing.lights%27-module.html#gluLookAt"><a title="pyprocessing.lights'.gluLookAt" class="py-name" href="#" onclick="return doclink('link-31', 'gluLookAt', 'link-31');">gluLookAt</a></tt> <tt class="py-op">(</tt><tt id="link-32" class="py-name" targets="Variable pyprocessing.globs.screen.width=pyprocessing.globs.screen-class.html#width,Variable pyprocessing.pimage.PImage.width=pyprocessing.pimage.PImage-class.html#width"><a title="pyprocessing.globs.screen.width
pyprocessing.pimage.PImage.width" class="py-name" href="#" onclick="return doclink('link-32', 'width', 'link-32');">width</a></tt><tt class="py-op">/</tt><tt class="py-number">2.0</tt><tt class="py-op">,</tt> <tt id="link-33" class="py-name" targets="Variable pyprocessing.globs.screen.height=pyprocessing.globs.screen-class.html#height,Variable pyprocessing.pimage.PImage.height=pyprocessing.pimage.PImage-class.html#height"><a title="pyprocessing.globs.screen.height
pyprocessing.pimage.PImage.height" class="py-name" href="#" onclick="return doclink('link-33', 'height', 'link-33');">height</a></tt><tt class="py-op">/</tt><tt class="py-number">2.0</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt id="link-34" class="py-name"><a title="pyprocessing.globs.screen.height
pyprocessing.pimage.PImage.height" class="py-name" href="#" onclick="return doclink('link-34', 'height', 'link-33');">height</a></tt><tt class="py-op">/</tt><tt class="py-number">2.0</tt><tt class="py-op">)</tt> <tt class="py-op">/</tt> <tt class="py-name">tan</tt><tt class="py-op">(</tt><tt id="link-35" class="py-name" targets="Variable pyprocessing.constants.PI=pyprocessing.constants-module.html#PI,Variable pyprocessing.lights'.PI=pyprocessing.lights%27-module.html#PI"><a title="pyprocessing.constants.PI
pyprocessing.lights'.PI" class="py-name" href="#" onclick="return doclink('link-35', 'PI', 'link-35');">PI</a></tt><tt class="py-op">*</tt><tt class="py-number">60.0</tt> <tt class="py-op">/</tt> <tt class="py-number">360.0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt>  </tt>
<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">                   <tt id="link-36" class="py-name"><a title="pyprocessing.globs.screen.width
pyprocessing.pimage.PImage.width" class="py-name" href="#" onclick="return doclink('link-36', 'width', 'link-32');">width</a></tt><tt class="py-op">/</tt><tt class="py-number">2.0</tt><tt class="py-op">,</tt> <tt id="link-37" class="py-name"><a title="pyprocessing.globs.screen.height
pyprocessing.pimage.PImage.height" class="py-name" href="#" onclick="return doclink('link-37', 'height', 'link-33');">height</a></tt><tt class="py-op">/</tt><tt class="py-number">2.0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line">        <tt class="py-keyword">assert</tt> <tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-number">9</tt><tt class="py-op">)</tt> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line">        <tt id="link-38" class="py-name"><a title="pyprocessing.lights'.gluLookAt" class="py-name" href="#" onclick="return doclink('link-38', 'gluLookAt', 'link-31');">gluLookAt</a></tt> <tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">args</tt><tt class="py-op">)</tt> </tt>
</div><a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line"> </tt>
<a name="perspective"></a><div id="perspective-def"><a name="L125"></a><tt class="py-lineno">125</tt> <a class="py-toggle" href="#" id="perspective-toggle" onclick="return toggle('perspective');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#perspective">perspective</a><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="perspective-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="perspective-expanded"><a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line">    <tt class="py-docstring">"""Args should either be empty or be of the form </tt> </tt>
<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line"><tt class="py-docstring">    (fov,aspect,znear,zfar). Loads a perspective projection matrix, where</tt> </tt>
<a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line"><tt class="py-docstring">    fov is the field-of-view angle (in radians) for vertical direction, aspect</tt> </tt>
<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line"><tt class="py-docstring">    is the ratio of width to height, znear is the z-position of nearest clipping </tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line"><tt class="py-docstring">    plane and zfar is the z-position of nearest farthest plane. If no args are</tt> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line"><tt class="py-docstring">    passed, the standard projection is created, i.e, equivalent to </tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line"><tt class="py-docstring">    perspective(PI/3.0, width/height, cameraZ/10.0, cameraZ*10.0)</tt> </tt>
<a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line"><tt class="py-docstring">    where cameraZ is ((height/2.0) / tan(PI*60.0/360.0))."""</tt> </tt>
<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line">    <tt id="link-39" class="py-name" targets="Variable pyprocessing.lights'.glMatrixMode=pyprocessing.lights%27-module.html#glMatrixMode"><a title="pyprocessing.lights'.glMatrixMode" class="py-name" href="#" onclick="return doclink('link-39', 'glMatrixMode', 'link-39');">glMatrixMode</a></tt><tt class="py-op">(</tt><tt id="link-40" class="py-name" targets="Variable pyprocessing.lights'.GL_PROJECTION=pyprocessing.lights%27-module.html#GL_PROJECTION"><a title="pyprocessing.lights'.GL_PROJECTION" class="py-name" href="#" onclick="return doclink('link-40', 'GL_PROJECTION', 'link-40');">GL_PROJECTION</a></tt><tt class="py-op">)</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line">    <tt id="link-41" class="py-name"><a title="pyprocessing.lights'.glLoadIdentity" class="py-name" href="#" onclick="return doclink('link-41', 'glLoadIdentity', 'link-5');">glLoadIdentity</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L136"></a><tt class="py-lineno">136</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line">        <tt class="py-name">cameraZ</tt> <tt class="py-op">=</tt> <tt id="link-42" class="py-name"><a title="pyprocessing.globs.screen.height
pyprocessing.pimage.PImage.height" class="py-name" href="#" onclick="return doclink('link-42', 'height', 'link-33');">height</a></tt><tt class="py-op">/</tt><tt class="py-number">2.0</tt> <tt class="py-op">/</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">tan</tt><tt class="py-op">(</tt><tt class="py-name">math</tt><tt class="py-op">.</tt><tt id="link-43" class="py-name" targets="Variable pyprocessing.pi=pyprocessing-module.html#pi,Variable pyprocessing.shapes.pi=pyprocessing.shapes-module.html#pi,Variable pyprocessing.transformations.pi=pyprocessing.transformations-module.html#pi"><a title="pyprocessing.pi
pyprocessing.shapes.pi
pyprocessing.transformations.pi" class="py-name" href="#" onclick="return doclink('link-43', 'pi', 'link-43');">pi</a></tt><tt class="py-op">*</tt><tt class="py-number">60</tt><tt class="py-op">/</tt><tt class="py-number">360</tt><tt class="py-op">)</tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line">        <tt id="link-44" class="py-name" targets="Variable pyprocessing.lights'.gluPerspective=pyprocessing.lights%27-module.html#gluPerspective"><a title="pyprocessing.lights'.gluPerspective" class="py-name" href="#" onclick="return doclink('link-44', 'gluPerspective', 'link-44');">gluPerspective</a></tt><tt class="py-op">(</tt><tt class="py-number">60</tt><tt class="py-op">,</tt> <tt id="link-45" class="py-name"><a title="pyprocessing.globs.screen.width
pyprocessing.pimage.PImage.width" class="py-name" href="#" onclick="return doclink('link-45', 'width', 'link-32');">width</a></tt><tt class="py-op">*</tt><tt class="py-number">1.0</tt><tt class="py-op">/</tt><tt id="link-46" class="py-name"><a title="pyprocessing.globs.screen.height
pyprocessing.pimage.PImage.height" class="py-name" href="#" onclick="return doclink('link-46', 'height', 'link-33');">height</a></tt><tt class="py-op">,</tt> <tt class="py-name">cameraZ</tt><tt class="py-op">/</tt><tt class="py-number">100.0</tt><tt class="py-op">,</tt> <tt class="py-name">cameraZ</tt><tt class="py-op">*</tt><tt class="py-number">10.0</tt><tt class="py-op">)</tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line">        <tt class="py-keyword">assert</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-number">4</tt><tt class="py-op">)</tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line">        <tt class="py-name">fov</tt><tt class="py-op">,</tt><tt class="py-name">aspect</tt><tt class="py-op">,</tt><tt class="py-name">znear</tt><tt class="py-op">,</tt><tt class="py-name">zfar</tt> <tt class="py-op">=</tt> <tt class="py-name">args</tt> </tt>
<a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line">        <tt id="link-47" class="py-name"><a title="pyprocessing.lights'.gluPerspective" class="py-name" href="#" onclick="return doclink('link-47', 'gluPerspective', 'link-44');">gluPerspective</a></tt><tt class="py-op">(</tt><tt class="py-name">degrees</tt><tt class="py-op">(</tt><tt class="py-name">fov</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">aspect</tt><tt class="py-op">,</tt><tt class="py-name">znear</tt><tt class="py-op">,</tt><tt class="py-name">zfar</tt><tt class="py-op">)</tt> </tt>
<a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line">    <tt class="py-comment"># invert the y axis</tt> </tt>
<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-keyword">if</tt> <tt id="link-48" class="py-name"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-48', 'config', 'link-2');">config</a></tt><tt class="py-op">.</tt><tt id="link-49" class="py-name" targets="Variable pyprocessing.config.coordInversionHack=pyprocessing.config-module.html#coordInversionHack"><a title="pyprocessing.config.coordInversionHack" class="py-name" href="#" onclick="return doclink('link-49', 'coordInversionHack', 'link-49');">coordInversionHack</a></tt><tt class="py-op">:</tt> <tt id="link-50" class="py-name"><a title="pyprocessing.lights'.glScalef" class="py-name" href="#" onclick="return doclink('link-50', 'glScalef', 'link-24');">glScalef</a></tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line">    <tt id="link-51" class="py-name"><a title="pyprocessing.lights'.glMatrixMode" class="py-name" href="#" onclick="return doclink('link-51', 'glMatrixMode', 'link-39');">glMatrixMode</a></tt><tt class="py-op">(</tt><tt id="link-52" class="py-name" targets="Variable pyprocessing.lights'.GL_MODELVIEW=pyprocessing.lights%27-module.html#GL_MODELVIEW"><a title="pyprocessing.lights'.GL_MODELVIEW" class="py-name" href="#" onclick="return doclink('link-52', 'GL_MODELVIEW', 'link-52');">GL_MODELVIEW</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L146"></a><tt class="py-lineno">146</tt>  <tt class="py-line"> </tt>
<a name="ortho"></a><div id="ortho-def"><a name="L147"></a><tt class="py-lineno">147</tt> <a class="py-toggle" href="#" id="ortho-toggle" onclick="return toggle('ortho');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#ortho">ortho</a><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ortho-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="ortho-expanded"><a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line">    <tt class="py-docstring">"""Args should either be empty or be of the form </tt> </tt>
<a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line"><tt class="py-docstring">    (left, right, bottom, top, near, far). Loads an orthogonal projection matrix.</tt> </tt>
<a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line"><tt class="py-docstring">    The clipping volume in this case is an axes-aligned parallelepiped, where </tt> </tt>
<a name="L151"></a><tt class="py-lineno">151</tt>  <tt class="py-line"><tt class="py-docstring">    left and right are the minimum and maximum x values, top and bottom are </tt> </tt>
<a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line"><tt class="py-docstring">    the minimum and maximum y values, and near and far are the minimum and </tt> </tt>
<a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line"><tt class="py-docstring">    maximum z values. If no parameters are given, the default is used: </tt> </tt>
<a name="L154"></a><tt class="py-lineno">154</tt>  <tt class="py-line"><tt class="py-docstring">    ortho(0, width, 0, height, -10, 10)."""</tt> </tt>
<a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line">    <tt id="link-53" class="py-name"><a title="pyprocessing.lights'.glMatrixMode" class="py-name" href="#" onclick="return doclink('link-53', 'glMatrixMode', 'link-39');">glMatrixMode</a></tt><tt class="py-op">(</tt><tt id="link-54" class="py-name"><a title="pyprocessing.lights'.GL_PROJECTION" class="py-name" href="#" onclick="return doclink('link-54', 'GL_PROJECTION', 'link-40');">GL_PROJECTION</a></tt><tt class="py-op">)</tt> </tt>
<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line">    <tt id="link-55" class="py-name"><a title="pyprocessing.lights'.glLoadIdentity" class="py-name" href="#" onclick="return doclink('link-55', 'glLoadIdentity', 'link-5');">glLoadIdentity</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L158"></a><tt class="py-lineno">158</tt>  <tt class="py-line">        <tt class="py-name">left</tt><tt class="py-op">,</tt> <tt class="py-name">right</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt id="link-56" class="py-name"><a title="pyprocessing.globs.screen.width
pyprocessing.pimage.PImage.width" class="py-name" href="#" onclick="return doclink('link-56', 'width', 'link-32');">width</a></tt> </tt>
<a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line">        <tt class="py-name">bottom</tt><tt class="py-op">,</tt> <tt class="py-name">top</tt> <tt class="py-op">=</tt>  <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt id="link-57" class="py-name"><a title="pyprocessing.globs.screen.height
pyprocessing.pimage.PImage.height" class="py-name" href="#" onclick="return doclink('link-57', 'height', 'link-33');">height</a></tt> </tt>
<a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line">        <tt class="py-name">near</tt><tt class="py-op">,</tt> <tt class="py-name">far</tt> <tt class="py-op">=</tt> <tt class="py-op">-</tt><tt id="link-58" class="py-name"><a title="pyprocessing.globs.screen.height
pyprocessing.pimage.PImage.height" class="py-name" href="#" onclick="return doclink('link-58', 'height', 'link-33');">height</a></tt><tt class="py-op">*</tt><tt class="py-number">2</tt><tt class="py-op">,</tt> <tt id="link-59" class="py-name"><a title="pyprocessing.globs.screen.height
pyprocessing.pimage.PImage.height" class="py-name" href="#" onclick="return doclink('link-59', 'height', 'link-33');">height</a></tt><tt class="py-op">*</tt><tt class="py-number">2</tt> <tt class="py-comment"># a saner default than Processing's</tt> </tt>
<a name="L161"></a><tt class="py-lineno">161</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L162"></a><tt class="py-lineno">162</tt>  <tt class="py-line">        <tt class="py-keyword">assert</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">args</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-number">6</tt><tt class="py-op">)</tt> </tt>
<a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line">        <tt class="py-name">left</tt><tt class="py-op">,</tt> <tt class="py-name">right</tt><tt class="py-op">,</tt> <tt class="py-name">bottom</tt><tt class="py-op">,</tt> <tt class="py-name">top</tt><tt class="py-op">,</tt> <tt class="py-name">near</tt><tt class="py-op">,</tt> <tt class="py-name">far</tt> <tt class="py-op">=</tt> <tt class="py-name">args</tt> </tt>
<a name="L164"></a><tt class="py-lineno">164</tt>  <tt class="py-line">    <tt class="py-comment"># invert the y axis</tt> </tt>
<a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-keyword">if</tt> <tt id="link-60" class="py-name"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-60', 'config', 'link-2');">config</a></tt><tt class="py-op">.</tt><tt id="link-61" class="py-name"><a title="pyprocessing.config.coordInversionHack" class="py-name" href="#" onclick="return doclink('link-61', 'coordInversionHack', 'link-49');">coordInversionHack</a></tt><tt class="py-op">:</tt> <tt class="py-name">bottom</tt><tt class="py-op">,</tt> <tt class="py-name">top</tt> <tt class="py-op">=</tt> <tt class="py-name">top</tt><tt class="py-op">,</tt> <tt class="py-name">bottom</tt> </tt>
<a name="L166"></a><tt class="py-lineno">166</tt>  <tt class="py-line">    <tt id="link-62" class="py-name" targets="Variable pyprocessing.lights'.glOrtho=pyprocessing.lights%27-module.html#glOrtho"><a title="pyprocessing.lights'.glOrtho" class="py-name" href="#" onclick="return doclink('link-62', 'glOrtho', 'link-62');">glOrtho</a></tt><tt class="py-op">(</tt><tt class="py-name">left</tt><tt class="py-op">,</tt> <tt class="py-name">right</tt><tt class="py-op">,</tt> <tt class="py-name">bottom</tt><tt class="py-op">,</tt> <tt class="py-name">top</tt><tt class="py-op">,</tt> <tt class="py-name">near</tt><tt class="py-op">,</tt> <tt class="py-name">far</tt><tt class="py-op">)</tt> </tt>
<a name="L167"></a><tt class="py-lineno">167</tt>  <tt class="py-line">    <tt id="link-63" class="py-name"><a title="pyprocessing.lights'.glMatrixMode" class="py-name" href="#" onclick="return doclink('link-63', 'glMatrixMode', 'link-39');">glMatrixMode</a></tt><tt class="py-op">(</tt><tt id="link-64" class="py-name"><a title="pyprocessing.lights'.GL_MODELVIEW" class="py-name" href="#" onclick="return doclink('link-64', 'GL_MODELVIEW', 'link-52');">GL_MODELVIEW</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line">     </tt>
<a name="screenXYZ"></a><div id="screenXYZ-def"><a name="L169"></a><tt class="py-lineno">169</tt> <a class="py-toggle" href="#" id="screenXYZ-toggle" onclick="return toggle('screenXYZ');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#screenXYZ">screenXYZ</a> <tt class="py-op">(</tt><tt class="py-param">ox</tt><tt class="py-op">,</tt><tt class="py-param">oy</tt><tt class="py-op">,</tt><tt class="py-param">oz</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="screenXYZ-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="screenXYZ-expanded"><a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line">    <tt class="py-docstring">"""Returns the projected space coordinates of object coordinates ox,oy,oz"""</tt> </tt>
<a name="L171"></a><tt class="py-lineno">171</tt>  <tt class="py-line">    <tt class="py-comment"># variables for calling gluUnProject</tt> </tt>
<a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-name">viewport</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_int</tt><tt class="py-op">*</tt><tt class="py-number">4</tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line">    <tt class="py-name">projmatrix</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_double</tt><tt class="py-op">*</tt><tt class="py-number">16</tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L174"></a><tt class="py-lineno">174</tt>  <tt class="py-line">    <tt class="py-name">mviewmatrix</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_double</tt><tt class="py-op">*</tt><tt class="py-number">16</tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L175"></a><tt class="py-lineno">175</tt>  <tt class="py-line">    <tt class="py-name">sx</tt><tt class="py-op">,</tt><tt class="py-name">sy</tt><tt class="py-op">,</tt><tt class="py-name">sz</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_double</tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_double</tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">c_double</tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line">    <tt class="py-comment"># get current transformation state</tt> </tt>
<a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt id="link-65" class="py-name" targets="Variable pyprocessing.lights'.glGetIntegerv=pyprocessing.lights%27-module.html#glGetIntegerv"><a title="pyprocessing.lights'.glGetIntegerv" class="py-name" href="#" onclick="return doclink('link-65', 'glGetIntegerv', 'link-65');">glGetIntegerv</a></tt><tt class="py-op">(</tt><tt id="link-66" class="py-name" targets="Variable pyprocessing.lights'.GL_VIEWPORT=pyprocessing.lights%27-module.html#GL_VIEWPORT"><a title="pyprocessing.lights'.GL_VIEWPORT" class="py-name" href="#" onclick="return doclink('link-66', 'GL_VIEWPORT', 'link-66');">GL_VIEWPORT</a></tt><tt class="py-op">,</tt> <tt class="py-name">viewport</tt><tt class="py-op">)</tt> </tt>
<a name="L178"></a><tt class="py-lineno">178</tt>  <tt class="py-line">    <tt id="link-67" class="py-name"><a title="pyprocessing.lights'.glGetDoublev" class="py-name" href="#" onclick="return doclink('link-67', 'glGetDoublev', 'link-9');">glGetDoublev</a></tt><tt class="py-op">(</tt><tt id="link-68" class="py-name"><a title="pyprocessing.lights'.GL_MODELVIEW_MATRIX" class="py-name" href="#" onclick="return doclink('link-68', 'GL_MODELVIEW_MATRIX', 'link-10');">GL_MODELVIEW_MATRIX</a></tt><tt class="py-op">,</tt> <tt class="py-name">mviewmatrix</tt><tt class="py-op">)</tt> </tt>
<a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line">    <tt id="link-69" class="py-name"><a title="pyprocessing.lights'.glGetDoublev" class="py-name" href="#" onclick="return doclink('link-69', 'glGetDoublev', 'link-9');">glGetDoublev</a></tt><tt class="py-op">(</tt><tt id="link-70" class="py-name"><a title="pyprocessing.lights'.GL_PROJECTION_MATRIX" class="py-name" href="#" onclick="return doclink('link-70', 'GL_PROJECTION_MATRIX', 'link-12');">GL_PROJECTION_MATRIX</a></tt><tt class="py-op">,</tt> <tt class="py-name">projmatrix</tt><tt class="py-op">)</tt> </tt>
<a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line">    <tt class="py-comment"># call gluUnProject</tt> </tt>
<a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt id="link-71" class="py-name" targets="Variable pyprocessing.lights'.gluProject=pyprocessing.lights%27-module.html#gluProject"><a title="pyprocessing.lights'.gluProject" class="py-name" href="#" onclick="return doclink('link-71', 'gluProject', 'link-71');">gluProject</a></tt><tt class="py-op">(</tt><tt class="py-name">ox</tt><tt class="py-op">,</tt><tt class="py-name">oy</tt><tt class="py-op">,</tt><tt class="py-name">oz</tt><tt class="py-op">,</tt> </tt>
<a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line">               <tt class="py-name">mviewmatrix</tt><tt class="py-op">,</tt><tt class="py-name">projmatrix</tt><tt class="py-op">,</tt><tt class="py-name">viewport</tt><tt class="py-op">,</tt> </tt>
<a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line">               <tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">byref</tt><tt class="py-op">(</tt><tt class="py-name">sx</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">byref</tt><tt class="py-op">(</tt><tt class="py-name">sy</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">ctypes</tt><tt class="py-op">.</tt><tt class="py-name">byref</tt><tt class="py-op">(</tt><tt class="py-name">sz</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L184"></a><tt class="py-lineno">184</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-72" class="py-name"><a title="pyprocessing.config
pyprocessing.globs.canvas.config" class="py-name" href="#" onclick="return doclink('link-72', 'config', 'link-2');">config</a></tt><tt class="py-op">.</tt><tt id="link-73" class="py-name"><a title="pyprocessing.config.coordInversionHack" class="py-name" href="#" onclick="return doclink('link-73', 'coordInversionHack', 'link-49');">coordInversionHack</a></tt><tt class="py-op">:</tt>  </tt>
<a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">sx</tt><tt class="py-op">.</tt><tt class="py-name">value</tt><tt class="py-op">,</tt> <tt id="link-74" class="py-name"><a title="pyprocessing.globs.screen.height
pyprocessing.pimage.PImage.height" class="py-name" href="#" onclick="return doclink('link-74', 'height', 'link-33');">height</a></tt><tt class="py-op">-</tt><tt class="py-name">sy</tt><tt class="py-op">.</tt><tt class="py-name">value</tt><tt class="py-op">,</tt> <tt class="py-name">sz</tt><tt class="py-op">.</tt><tt class="py-name">value</tt> </tt>
<a name="L186"></a><tt class="py-lineno">186</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L187"></a><tt class="py-lineno">187</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">sx</tt><tt class="py-op">.</tt><tt class="py-name">value</tt><tt class="py-op">,</tt> <tt class="py-name">sy</tt><tt class="py-op">.</tt><tt class="py-name">value</tt><tt class="py-op">,</tt> <tt class="py-name">sz</tt><tt class="py-op">.</tt><tt class="py-name">value</tt> </tt>
</div><a name="L188"></a><tt class="py-lineno">188</tt>  <tt class="py-line">     </tt>
<a name="screenX"></a><div id="screenX-def"><a name="L189"></a><tt class="py-lineno">189</tt> <a class="py-toggle" href="#" id="screenX-toggle" onclick="return toggle('screenX');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#screenX">screenX</a> <tt class="py-op">(</tt><tt class="py-param">ox</tt><tt class="py-op">,</tt><tt class="py-param">oy</tt><tt class="py-op">,</tt><tt class="py-param">oz</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="screenX-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="screenX-expanded"><a name="L190"></a><tt class="py-lineno">190</tt>  <tt class="py-line">    <tt class="py-docstring">"""Returns the x coordinate of screenXYZ(ox,oy,oz)"""</tt> </tt>
<a name="L191"></a><tt class="py-lineno">191</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-75" class="py-name" targets="Function pyprocessing.transformations.screenXYZ()=pyprocessing.transformations-module.html#screenXYZ"><a title="pyprocessing.transformations.screenXYZ" class="py-name" href="#" onclick="return doclink('link-75', 'screenXYZ', 'link-75');">screenXYZ</a></tt><tt class="py-op">(</tt><tt class="py-name">ox</tt><tt class="py-op">,</tt><tt class="py-name">oy</tt><tt class="py-op">,</tt><tt class="py-name">oz</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
</div><a name="L192"></a><tt class="py-lineno">192</tt>  <tt class="py-line"> </tt>
<a name="screenY"></a><div id="screenY-def"><a name="L193"></a><tt class="py-lineno">193</tt> <a class="py-toggle" href="#" id="screenY-toggle" onclick="return toggle('screenY');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#screenY">screenY</a> <tt class="py-op">(</tt><tt class="py-param">ox</tt><tt class="py-op">,</tt><tt class="py-param">oy</tt><tt class="py-op">,</tt><tt class="py-param">oz</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="screenY-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="screenY-expanded"><a name="L194"></a><tt class="py-lineno">194</tt>  <tt class="py-line">    <tt class="py-docstring">"""Returns the y coordinate of screenXYZ(ox,oy,oz)"""</tt> </tt>
<a name="L195"></a><tt class="py-lineno">195</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-76" class="py-name"><a title="pyprocessing.transformations.screenXYZ" class="py-name" href="#" onclick="return doclink('link-76', 'screenXYZ', 'link-75');">screenXYZ</a></tt><tt class="py-op">(</tt><tt class="py-name">ox</tt><tt class="py-op">,</tt><tt class="py-name">oy</tt><tt class="py-op">,</tt><tt class="py-name">oz</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
</div><a name="L196"></a><tt class="py-lineno">196</tt>  <tt class="py-line">     </tt>
<a name="screenZ"></a><div id="screenZ-def"><a name="L197"></a><tt class="py-lineno">197</tt> <a class="py-toggle" href="#" id="screenZ-toggle" onclick="return toggle('screenZ');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyprocessing.transformations-module.html#screenZ">screenZ</a> <tt class="py-op">(</tt><tt class="py-param">ox</tt><tt class="py-op">,</tt><tt class="py-param">oy</tt><tt class="py-op">,</tt><tt class="py-param">oz</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="screenZ-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="screenZ-expanded"><a name="L198"></a><tt class="py-lineno">198</tt>  <tt class="py-line">    <tt class="py-docstring">"""Returns the Z coordinate of screenXYZ(ox,oy,oz)"""</tt> </tt>
<a name="L199"></a><tt class="py-lineno">199</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-77" class="py-name"><a title="pyprocessing.transformations.screenXYZ" class="py-name" href="#" onclick="return doclink('link-77', 'screenXYZ', 'link-75');">screenXYZ</a></tt><tt class="py-op">(</tt><tt class="py-name">ox</tt><tt class="py-op">,</tt><tt class="py-name">oy</tt><tt class="py-op">,</tt><tt class="py-name">oz</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> </tt>
</div><a name="L200"></a><tt class="py-lineno">200</tt>  <tt class="py-line"> </tt>
<a name="L201"></a><tt class="py-lineno">201</tt>  <tt class="py-line"><tt class="py-comment"># As far as I can understand, modelX, modelY and modelZ are synonyms of </tt> </tt>
<a name="L202"></a><tt class="py-lineno">202</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># screenX, screenY and screenZ</tt> </tt>
<a name="L203"></a><tt class="py-lineno">203</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-name">modelX</tt><tt class="py-op">,</tt> <tt class="py-name">modelY</tt><tt class="py-op">,</tt> <tt class="py-name">modelZ</tt><tt class="py-op">,</tt> <tt class="py-name">modelXYZ</tt> <tt class="py-op">=</tt> <tt id="link-78" class="py-name" targets="Function pyprocessing.transformations.screenX()=pyprocessing.transformations-module.html#screenX"><a title="pyprocessing.transformations.screenX" class="py-name" href="#" onclick="return doclink('link-78', 'screenX', 'link-78');">screenX</a></tt><tt class="py-op">,</tt> <tt id="link-79" class="py-name" targets="Function pyprocessing.transformations.screenY()=pyprocessing.transformations-module.html#screenY"><a title="pyprocessing.transformations.screenY" class="py-name" href="#" onclick="return doclink('link-79', 'screenY', 'link-79');">screenY</a></tt><tt class="py-op">,</tt> <tt id="link-80" class="py-name" targets="Function pyprocessing.transformations.screenZ()=pyprocessing.transformations-module.html#screenZ"><a title="pyprocessing.transformations.screenZ" class="py-name" href="#" onclick="return doclink('link-80', 'screenZ', 'link-80');">screenZ</a></tt><tt class="py-op">,</tt> <tt id="link-81" class="py-name"><a title="pyprocessing.transformations.screenXYZ" class="py-name" href="#" onclick="return doclink('link-81', 'screenXYZ', 'link-75');">screenXYZ</a></tt> </tt>
<a name="L204"></a><tt class="py-lineno">204</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pyprocessing-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Mon Jun 11 22:06:47 2012
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
